Integrand size = 17, antiderivative size = 51 \[ \int \sqrt {a+b \cot ^2(x)} \tan ^2(x) \, dx=\sqrt {a-b} \arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+\sqrt {a+b \cot ^2(x)} \tan (x) \]
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.10 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.86 \[ \int \sqrt {a+b \cot ^2(x)} \tan ^2(x) \, dx=\sqrt {a+b \cot ^2(x)} \operatorname {Hypergeometric2F1}\left (-\frac {1}{2},1,\frac {1}{2},-\frac {(a-b) \cot ^2(x)}{a+b \cot ^2(x)}\right ) \tan (x) \]
Sqrt[a + b*Cot[x]^2]*Hypergeometric2F1[-1/2, 1, 1/2, -(((a - b)*Cot[x]^2)/ (a + b*Cot[x]^2))]*Tan[x]
Time = 0.28 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.412, Rules used = {3042, 4153, 377, 25, 27, 291, 216}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \tan ^2(x) \sqrt {a+b \cot ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sqrt {a+b \tan \left (x+\frac {\pi }{2}\right )^2}}{\tan \left (x+\frac {\pi }{2}\right )^2}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle -\int \frac {\sqrt {b \cot ^2(x)+a} \tan ^2(x)}{\cot ^2(x)+1}d\cot (x)\) |
\(\Big \downarrow \) 377 |
\(\displaystyle \tan (x) \sqrt {a+b \cot ^2(x)}-\int -\frac {a-b}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \int \frac {a-b}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)+\tan (x) \sqrt {a+b \cot ^2(x)}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle (a-b) \int \frac {1}{\left (\cot ^2(x)+1\right ) \sqrt {b \cot ^2(x)+a}}d\cot (x)+\tan (x) \sqrt {a+b \cot ^2(x)}\) |
\(\Big \downarrow \) 291 |
\(\displaystyle (a-b) \int \frac {1}{1-\frac {(b-a) \cot ^2(x)}{b \cot ^2(x)+a}}d\frac {\cot (x)}{\sqrt {b \cot ^2(x)+a}}+\tan (x) \sqrt {a+b \cot ^2(x)}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \sqrt {a-b} \arctan \left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )+\tan (x) \sqrt {a+b \cot ^2(x)}\) |
3.1.24.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst [Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_) , x_Symbol] :> Simp[(e*x)^(m + 1)*(a + b*x^2)^(p + 1)*((c + d*x^2)^q/(a*e*( m + 1))), x] - Simp[1/(a*e^2*(m + 1)) Int[(e*x)^(m + 2)*(a + b*x^2)^p*(c + d*x^2)^(q - 1)*Simp[b*c*(m + 1) + 2*(b*c*(p + 1) + a*d*q) + d*(b*(m + 1) + 2*b*(p + q + 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, p}, x] && NeQ[b *c - a*d, 0] && LtQ[0, q, 1] && LtQ[m, -1] && IntBinomialQ[a, b, c, d, e, m , 2, p, q, x]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Leaf count of result is larger than twice the leaf count of optimal. \(311\) vs. \(2(43)=86\).
Time = 0.87 (sec) , antiderivative size = 312, normalized size of antiderivative = 6.12
method | result | size |
default | \(\frac {\sqrt {4}\, \sqrt {a +b \cot \left (x \right )^{2}}\, \left (\ln \left (4 \cos \left (x \right ) \sqrt {-a +b}\, \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}-4 \cos \left (x \right ) a +4 b \cos \left (x \right )+4 \sqrt {-a +b}\, \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\right ) a \sin \left (x \right )-\ln \left (4 \cos \left (x \right ) \sqrt {-a +b}\, \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}-4 \cos \left (x \right ) a +4 b \cos \left (x \right )+4 \sqrt {-a +b}\, \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\right ) b \sin \left (x \right )+\sqrt {-a +b}\, \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sin \left (x \right )+\sqrt {-a +b}\, \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \tan \left (x \right )\right )}{2 \sqrt {-a +b}\, \sqrt {-\frac {a \cos \left (x \right )^{2}-\cos \left (x \right )^{2} b -a}{\left (\cos \left (x \right )+1\right )^{2}}}\, \left (\cos \left (x \right )+1\right )}\) | \(312\) |
1/2*4^(1/2)/(-a+b)^(1/2)*(a+b*cot(x)^2)^(1/2)/(-(a*cos(x)^2-cos(x)^2*b-a)/ (cos(x)+1)^2)^(1/2)/(cos(x)+1)*(ln(4*cos(x)*(-a+b)^(1/2)*(-(a*cos(x)^2-cos (x)^2*b-a)/(cos(x)+1)^2)^(1/2)-4*cos(x)*a+4*b*cos(x)+4*(-a+b)^(1/2)*(-(a*c os(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2))*a*sin(x)-ln(4*cos(x)*(-a+b)^(1/ 2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)-4*cos(x)*a+4*b*cos(x)+4 *(-a+b)^(1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2))*b*sin(x)+(- a+b)^(1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*sin(x)+(-a+b)^( 1/2)*(-(a*cos(x)^2-cos(x)^2*b-a)/(cos(x)+1)^2)^(1/2)*tan(x))
Time = 0.31 (sec) , antiderivative size = 193, normalized size of antiderivative = 3.78 \[ \int \sqrt {a+b \cot ^2(x)} \tan ^2(x) \, dx=\left [\frac {1}{4} \, \sqrt {-a + b} \log \left (-\frac {a^{2} \tan \left (x\right )^{4} - 2 \, {\left (3 \, a^{2} - 4 \, a b\right )} \tan \left (x\right )^{2} + a^{2} - 8 \, a b + 8 \, b^{2} - 4 \, {\left (a \tan \left (x\right )^{3} - {\left (a - 2 \, b\right )} \tan \left (x\right )\right )} \sqrt {-a + b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}}}{\tan \left (x\right )^{4} + 2 \, \tan \left (x\right )^{2} + 1}\right ) + \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right ), \frac {1}{2} \, \sqrt {a - b} \arctan \left (\frac {2 \, \sqrt {a - b} \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )}{a \tan \left (x\right )^{2} - a + 2 \, b}\right ) + \sqrt {\frac {a \tan \left (x\right )^{2} + b}{\tan \left (x\right )^{2}}} \tan \left (x\right )\right ] \]
[1/4*sqrt(-a + b)*log(-(a^2*tan(x)^4 - 2*(3*a^2 - 4*a*b)*tan(x)^2 + a^2 - 8*a*b + 8*b^2 - 4*(a*tan(x)^3 - (a - 2*b)*tan(x))*sqrt(-a + b)*sqrt((a*tan (x)^2 + b)/tan(x)^2))/(tan(x)^4 + 2*tan(x)^2 + 1)) + sqrt((a*tan(x)^2 + b) /tan(x)^2)*tan(x), 1/2*sqrt(a - b)*arctan(2*sqrt(a - b)*sqrt((a*tan(x)^2 + b)/tan(x)^2)*tan(x)/(a*tan(x)^2 - a + 2*b)) + sqrt((a*tan(x)^2 + b)/tan(x )^2)*tan(x)]
\[ \int \sqrt {a+b \cot ^2(x)} \tan ^2(x) \, dx=\int \sqrt {a + b \cot ^{2}{\left (x \right )}} \tan ^{2}{\left (x \right )}\, dx \]
\[ \int \sqrt {a+b \cot ^2(x)} \tan ^2(x) \, dx=\int { \sqrt {b \cot \left (x\right )^{2} + a} \tan \left (x\right )^{2} \,d x } \]
Leaf count of result is larger than twice the leaf count of optimal. 239 vs. \(2 (43) = 86\).
Time = 0.29 (sec) , antiderivative size = 239, normalized size of antiderivative = 4.69 \[ \int \sqrt {a+b \cot ^2(x)} \tan ^2(x) \, dx=\frac {1}{2} \, {\left (\sqrt {-a + b} \log \left ({\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2}\right ) - \frac {4 \, a \sqrt {-a + b}}{{\left (\sqrt {-a + b} \cos \left (x\right ) - \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a}\right )}^{2} - a}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right ) - \frac {{\left (a \sqrt {-a + b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - a \sqrt {b} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) - \sqrt {-a + b} b \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + b^{\frac {3}{2}} \log \left (-a - 2 \, \sqrt {-a + b} \sqrt {b} + 2 \, b\right ) + 2 \, a \sqrt {-a + b}\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{2 \, {\left (a + \sqrt {-a + b} \sqrt {b} - b\right )}} \]
1/2*(sqrt(-a + b)*log((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b*cos(x)^2 + a))^2) - 4*a*sqrt(-a + b)/((sqrt(-a + b)*cos(x) - sqrt(-a*cos(x)^2 + b* cos(x)^2 + a))^2 - a))*sgn(sin(x)) - 1/2*(a*sqrt(-a + b)*log(-a - 2*sqrt(- a + b)*sqrt(b) + 2*b) - a*sqrt(b)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) - sqrt(-a + b)*b*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + b^(3/2)*log(-a - 2*sqrt(-a + b)*sqrt(b) + 2*b) + 2*a*sqrt(-a + b))*sgn(sin(x))/(a + sqrt(-a + b)*sqrt(b) - b)
Timed out. \[ \int \sqrt {a+b \cot ^2(x)} \tan ^2(x) \, dx=\int {\mathrm {tan}\left (x\right )}^2\,\sqrt {b\,{\mathrm {cot}\left (x\right )}^2+a} \,d x \]